1. Field of the Invention
The present invention relates to a color correction method and program, particularly to a color correction method and program used to convert digital image data that can be reproduced with an apparatus such as a CRT (cathode ray tube) into image data that can be reproduced with an output apparatus such as a printer.
2. Description of the Related Art
The reproducible range of colors with CRTs and scanners generally differ from the reproducible range of colors with printers. When the color reproducible range (Gamut) differs between two such apparatuses, color matching must be implemented to reproduce an image corresponding to one apparatus at another apparatus. The color correction method (color matching method) in conventional art will be described briefly hereinafter.
A flow of image data is shown in FIG. 9 in order to describe the color matching method between an input apparatus 701 and an output apparatus 707. Here, the image data reproduced at input apparatus 701 such as a CRT or scanner corresponds to RGB data represented by the RGB color space. The image data reproduced at output apparatus 707 such as a printer corresponds to CMYK data represented by the CMY color space. As shown in FIG. 9, the RGB data are subjected to various conversion processings at a color conversion processor 703 to be eventually converted into CMYK data.
The RGB data at input apparatus 701 is applied to color conversion processor 703 to be converted into data of a color space independent of the device. L*a*b* space and XYZ space, for example, are known as a color space independent of the device. It is assumed that the RGB data is converted into data represented by the L*a*b* space (L*a*b* data). Conversion using an LUT (lookup table) or masking and the like are employed for the conversion process.
The converted L*a*b* data is then converted at a Gamut mapping unit 705 into L*a*b* data of a range that can be reproduced by output apparatus 707. In other words, color matching is implemented between input apparatus 701 and output apparatus 707 at Gamut mapping unit 705.
Since the data subjected to color matching is still in the form of data of a color space independent of the device (L*a*b* data), the data is further converted into CMYK data. Conversion using an LUT or masking or the like is employed for the conversion process here.
Thus, the image data reproduced at input apparatus 701 is subjected to color matching so as to be reproduced at output apparatus 707 after being converted into data of a color space independent of the device.
FIG. 10 is a flow chart of a color matching process at Gamut mapping unit 705 of FIG. 7. Referring to FIG. 10, in response to the input of data independent of the device (L*a*b* data) to Gamut mapping unit 706 at step S801, the gray axis is adjusted at step S803.
More specifically, the entire input Gamut is shifted so that the gray axis of the input Gamut (Gamut of the input apparatus) matches the gray scale of the output Gamut (Gamut of the output apparatus). By setting the gray axes of input and output apparatuses 701 and 707 in coincidence, a gray-balanced output image without color fogging will be obtained.
The gray axis refers to the line segment connecting the white point and the black point of respective apparatuses. For example, in the CRT, the color when all the R, G and B are turned on corresponds to the white point whereas the color when all the R, G and B are turned off corresponds to the black point. Here, the line segment connecting both points becomes the gray axis of the CRT in the L*a*b* color space. At the printer side, the color of the paper used corresponds to the white point whereas the output black corresponds to the black point. In the same L*a*b* color space, the line segment connecting these two points is the gray axis of the printer.
At step S804, the hue is adjusted by the rotary operation and the like of the input Gamut. In accordance with the shift of the entire Gamut in the gray axis adjustment process, there is a region in which the hue changes. The hue adjustment step is implemented to correct this change in hue.
At step S805, the value which is the relative lightness or darkness of a color (referred to as “lightness” hereinafter) and chroma are adjusted. More specifically, a compression process is implemented so that the lightness and chroma of the input Gamut match the lightness and chroma of the output Gamut.
When the range of lightness differs greatly between input apparatus 701 and output apparatus 707, the problem of no-print white reproduction as caused by halation or the dark area being reproduced solidly may occur in the output image. To this end, adjustment is effected so that the lightness range conforms to output apparatus 707. Furthermore, if the range of chroma greatly differs between input apparatus 701 and output apparatus 707, the output image will become entirely too vivid to appear flat or conversely lose its chromaticness. Thus, compression adjustment is implemented also for chroma to conform to the Gamut of output apparatus 707.
Following the compression process of lightness and chroma, control proceeds to step S807 where a pasting process is implemented. Data outside the Gamut of output apparatus 707 is pasted to the Gamut surface. This process is aimed to allow the image data located outside the output Gamut and that cannot be reproduced at output apparatus 707 to be reproduced appropriately.
The color matching process will be completed at the end of the data pasting process. At step S809, image data subjected to the matching process is output.
In the foregoing, the process flow at Gamut mapping unit 705 has been described.
In the following, a gray axis adjustment process of FIG. 10 (step S803) will be described with reference to FIGS. 11–13.
FIG. 11 shows the manner of shifting the gray axis of input apparatus 701 towards the direction of the gray axis of output apparatus 707 in the L*a*b* space. In FIG. 11, the white and black points of input apparatus 701 are Pwi and Pwi, respectively. The white and black points of output apparatus 707 are Pwo and Pbo, respectively. Gray axis li of input apparatus 601 connecting points Pwi and Pwi does not match gray axis lo of output apparatus 707 connecting points Pwo and Pbo.
Therefore, the data on gray axis Il is shifted parallel to the plane of a*b* so that gray axis li matches gray axis lo. More specifically, each data point on gray axis li is moved to a point on gray axis lo with its lightness maintained constant. For example, point P1 on gray axis li is shifted to point Pi′ of equal lightness on gray axis lo. Similarly, points P2 and P3 on gray axis li are moved to points P2′ and P3′, respectively, of equal lightness on gray axis lo.
FIG. 12 shows a cross section of the input Gamut in the L*a*b* space prior to the gray axis shift operation. Here, a cross section of the input Gamut on a plane of equal lightness parallel to plane a*b* is shown. The region Gin enclosed by a hexagon represents the input Gamut. A point P therein is the point where the gray axis of the input Gamut crosses. It is to be noted that the point where the gray axis of the output Gamut crosses the plane of equal lightness is point P′, and does not match point P.
FIG. 13 shows a cross section of the input Gamut in the L*a*b* space after the gray axis shift operation. A cross section of the input Gamut on a plane of equal lightness corresponding to FIG. 12 is shown. The region Gin enclosed by a hexagon in a dotted line represents the input Gamut prior to shifting of FIG. 12 whereas the region Gin′ enclosed by a hexagon in a solid line represents the input Gamut after the shifting operation.
By the gray axis adjust process, the entire data in region Gin of the input Gamut is moved so that point P matches point P′ on the plane of equal lightness at the output Gamut. More specifically, all the data at the plane of equal lightness are shifted in parallel with a vector similar to the vector corresponding to the shift of the gray axis (the arrow from point P to P′). Therefore, point q, for example, on region Gin of the input Gamut is shifted to point q′.
By shifting the entire input Gamut so that the gray axis of the input Gamut matches the gray axis of the output Gamut, a gray-balanced output image with no color fogging can be obtained.
The pasting process into the Gamut of FIG. 10 (step S807) (referred to as “Gamut compression process” hereinafter) will be described. The geometrical Gamut compression process of the conventional art is mainly classified into the four methods set forth below.
First method: input image data is compressed with a predetermined ratio towards the center point of the output Gamut.
Second method: chroma of the input image data is compressed towards the gray axis of the output Gamut without changing the hue of the input image data.
Third method: the lightness is compressed without changing the hue of the input image data.
Fourth method: the input image data is converted to be located in the output Gamut such that the color difference is minimized.
The above first and fourth methods will be described in further detail with reference to FIGS. 14–18.
FIG. 14 is a diagram to describe a Gamut compression process according to the first method. For the sake of simplification, a configuration that has two united cones with a circle on a plane parallel to the a*b* plane as the bottom is represented as the output Gamut Gout. Point P is a point outside output Gamut Gout. Point P′ is a point within output Gamut Gout (a point on the surface of Gout). In FIG. 14, the axes passing through the centroid Q of output Gamut Gout are assigned a* and b* to indicate the chromaticity.
Point P is compressed with a predetermined compression ratio in the direction of centroid Q which is the center point of compression on a plane H of equal hue including point P and lightness axis L*.
FIG. 15 shows this compression on plane H of equal hue. As shown in FIG. 15, point P outside output Gamut Gout is compressed in the direction of centroid Q to be converted into point P′ located in output Gamut Gout.
FIG. 16 is a diagram to describe a Gamut compression process according to the fourth method. For the sake of simplification, a configuration that has two hexagonal pyramids united with a hexagon on a plane parallel to plane a*b* as the bottom is represented as output Gamut Gout. Point P is a point located outside output Gamut Gout, and point P′ is a point located in output Gamut Gout (a point on the surface of Gout) with the smallest color difference ΔE from point P. As indicated by the arrow, point P outside output Gamut Gout is converted into point P′. Similarly in FIG. 16, the axes passing through the centroid of output Gamut Gout are assigned a* and b* to indicate the chromaticity.
Color difference ΔE between points P and P′ is generally represented as ΔE=((P (L*)−P′(L*))2+(P(a*)−P′(a*))2+(P(b*)−P′(b*))2)1/2. Here, P(L*), P(a*) and P(b*) are the values of the L* component, a* component and b* component, respectively, of the L*a*b* space at point P. Similarly, P′(L*), P′(a*) and P′(b*) are the values of the L* component, a* component and b* component, respectively, at point P′.
This manner is shown in FIGS. 17 and 18 represented at plane L*b* and plane a*b*, respectively. Referring to FIGS. 17 and 18, point P located outside output Gamut Gout is converted into point P′ located within output Gamut Gout corresponding to the smallest color difference ΔE from point P. This method differs from the first method in that there is no centroid of compression, and compression is effected in a direction not towards the centroid.
The image of the color can be represented appropriately by converting data located outside output Gamut into data located in output Gamut so that the color difference is minimized.
However, the conventional color correction method (color matching method) including gray axis adjustment and Gamut compression was not sufficient for the purpose of reproducing an image appropriately and easily at the output apparatus.
More specifically, gray axis adjustment causes the entire input Gamut to be moved according to the shift of the gray axis, so that other colors will be converted into slightly different colors. For example, in FIG. 13, point q in input Gamut prior to the shift becomes point q′ after the shift by the gray axis adjustment process. In this case, the blue color achieved at the input apparatus 701 will be reproduced as the color of purple at output apparatus 707. In the event that input apparatus 701 is a CRT and output apparatus 707 is a printer, a thoroughly reddish output image will be produced by the shift of the gray axis.
Thus, when the input Gamut is shifted by the gray axis adjustment process, the reproduced output image will be governed by the chromaticness in the shifting direction, resulting in an image slightly different from the input image.
The hue adjustment process to correct this difference requires the Gamut rotary operation and the like. Therefore, the process becomes very complicated and is extremely time consuming. Even if this complicated hue adjustment is applied, it was difficult to obtain an appropriate rendition of the image. For example, if the entire image is rotated in order to output blue as blue at the output side, the green color will be represented yellowish in color.
Furthermore, there was the case where the image retained by the input apparatus is ruined since the gray axis of the input Gamut is set to exactly match the gray axis of the output Gamut. Although a gray-balanced image without any color fogging can be obtained by adjusting the gray axis, the human viewer of the output image will probably be not satisfied. This is because the human observer possibly bears the image reproduced at the input apparatus and will be bothered by a feeling of strangeness when an image is reproduced that completely ruins the former image of the input apparatus.
Furthermore, since all the data located in the Gamut of the input apparatus are compressed at a predetermined compression ratio to come within the output Gamut according to the first and second methods of Gamut compression, an extremely large compression ratio will be set in practice. This induces the problem that the reproduced image will have extremely low chroma.
According to the third method of Gamut compression, there will be some image data such as the blue color of high chroma that cannot come into the output Gamut even if the lightness is compressed. There was a problem that such blue color cannot be reproduced at the output apparatus.
As to the fourth method of Gamut compression, there is a case where there is a relatively great difference in lightness before and after the compression process, particularly so great that the lightness is inverted. There was a problem that an image differing from the actual image that was observed by a human viewer is output.